#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <ctype.h>
//int main()
//{
//	//int ret=islower('A');
//	//int ret = isdigit('A');
//	//int ret = tolower('F');
//	//int ret = toupper('a');
//	printf("%c\n", toupper('a'));
//	return 0;
//}

//将字符串中的大写转换为小写
//int main()
//{
//	char arr[] = "I Have An Apple";
//	//如果是大写就转换为小写，然后输出；否则直接输出
//	int i = 0;
//	while (arr[i])
//	{
//		if (isupper(arr[i]))
//		{
//			//printf("%c",tolower(arr[i]));
//			arr[i] = tolower(arr[i]);
//		}
//		printf("%c",arr[i]);
//		i++;
//	}
//	
//	return 0;
//}

#include <string.h>
//int main()
//{
//	int arr1[] = {1,2,3,4,5,6,7,8,9,10};
//	int arr2[10] = { 0 };
//	//从源头copy
//	memcpy(arr2,arr1,4*5);
//	//从任意位置开始copy
//	memcpy(arr2+1,arr1+2,4*5);
//	//小端字节序，
//	//01 00 00 00 02 00 00 00 03 00 00 00
//	return 0;
//}

#include <assert.h>
//模拟实现memcpy,返回目的的地址
void* my_memcpy(void* destination,const void* resource,size_t num)
{
	assert(destination&&resource);
	//void* 不能被直接赋值
	void* ret = destination;
	while (num--)
	{
		*(char*)destination = *(char*)resource;
		((char*)destination)++;
		((char*)resource)++;
	}
	return ret;
	
}
int main()
{
	int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
	int arr2[10] = { 0 };
	my_memcpy(arr2,arr1+2,20);

	return 0;
}